/**
 * @param {HTMLElement} el
 * @returns {Object}
 */
export function getScrollPosition(el: HTMLElement | Window = window): { x: number; y: number } {
  if (el === window) {
    return {
      x: window.pageXOffset,
      y: window.pageYOffset
    }
  }
  return {
    x: (el as HTMLElement).scrollLeft,
    y: (el as HTMLElement).scrollTop
  }
} 